#!/usr/bin/env python


import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

#enedft
f.add(string = 'Final HF energy',
      rel_tolerance = 1.0e-9)

#qm3convergence
f.add(from_string = 'QM/MM "QMMM" calculation converged',
      num_lines = 9,
      rel_tolerance = 1.0e-8)


f.add(from_string = 'CC2 Total  energy',
      num_lines = 2,
      rel_tolerance = 1.0e-8)

#dipole
#f.add(from_string = 'Dipole moment',
#      num_lines = 5,
#      mask = [1],
#      rel_tolerance = 1.0e-5)

#dipcompx
#dipcompy
#dipcompz
#f.add(from_string = 'Dipole moment components',
#      num_lines = 8,
#      rel_tolerance = 1.0e-6)

#excita
#f.add(from_string = 'Singlet electronic excitation energies',
#      num_lines = 10,
#      rel_tolerance = 1.0e-6)


f.add(from_string = 'CC2        Excitation energies',
      num_lines = 25,
      rel_tolerance = 1.0e-6)


test.run(['qmmm_cc.dal'], ['formaldehyde.mol'], ['water.pot'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)


#
